<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="TarifaCreateDlg" widgetVar="TarifaCreateDialog" modal="true" resizable="false" appendToBody="true" header="#{bundle.CreateTarifaTitle}">

            <h:form id="TarifaCreateForm">

                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{tarifaController.selected != null}">

                        <p:outputLabel value="#{bundle.CreateTarifaLabel_id}" for="id" />
                        <p:inputText id="id" value="#{tarifaController.selected.id}" title="#{bundle.CreateTarifaTitle_id}" required="true" requiredMessage="#{bundle.CreateTarifaRequiredMessage_id}"/>

                        <p:outputLabel value="#{bundle.CreateTarifaLabel_codigo}" for="codigo" />
                        <p:inputText id="codigo" value="#{tarifaController.selected.codigo}" title="#{bundle.CreateTarifaTitle_codigo}" required="true" requiredMessage="#{bundle.CreateTarifaRequiredMessage_codigo}"/>

                        <p:outputLabel value="#{bundle.CreateTarifaLabel_monto}" for="monto" />
                        <p:inputText id="monto" value="#{tarifaController.selected.monto}" title="#{bundle.CreateTarifaTitle_monto}" required="true" requiredMessage="#{bundle.CreateTarifaRequiredMessage_monto}"/>

                        <p:outputLabel value="#{bundle.CreateTarifaLabel_fechaInicio}" for="fechaInicio" />
                        <p:calendar id="fechaInicio" pattern="MM/dd/yyyy" value="#{tarifaController.selected.fechaInicio}" title="#{bundle.EditTarifaTitle_fechaInicio}" required="true" requiredMessage="#{bundle.EditTarifaRequiredMessage_fechaInicio}" showOn="button"/>

                        <p:outputLabel value="#{bundle.CreateTarifaLabel_fechaFin}" for="fechaFin" />
                        <p:calendar id="fechaFin" pattern="MM/dd/yyyy" value="#{tarifaController.selected.fechaFin}" title="#{bundle.EditTarifaTitle_fechaFin}"  showOn="button"/>

                        <p:outputLabel value="#{bundle.CreateTarifaLabel_activo}" for="activo" />
                        <p:selectBooleanCheckbox id="activo" value="#{tarifaController.selected.activo}" title="#{bundle.EditTarifaTitle_activo}" required="true" requiredMessage="#{bundle.EditTarifaRequiredMessage_activo}"/>

                        <p:outputLabel value="#{bundle.CreateTarifaLabel_creationDate}" for="creationDate" />
                        <p:calendar id="creationDate" pattern="MM/dd/yyyy HH:mm:ss" value="#{tarifaController.selected.creationDate}" title="#{bundle.EditTarifaTitle_creationDate}" required="true" requiredMessage="#{bundle.EditTarifaRequiredMessage_creationDate}" showOn="button"/>

                        <p:outputLabel value="#{bundle.CreateTarifaLabel_createdBy}" for="createdBy" />
                        <p:inputText id="createdBy" value="#{tarifaController.selected.createdBy}" title="#{bundle.CreateTarifaTitle_createdBy}" required="true" requiredMessage="#{bundle.CreateTarifaRequiredMessage_createdBy}"/>

                        <p:outputLabel value="#{bundle.CreateTarifaLabel_lastUpdateDate}" for="lastUpdateDate" />
                        <p:calendar id="lastUpdateDate" pattern="MM/dd/yyyy HH:mm:ss" value="#{tarifaController.selected.lastUpdateDate}" title="#{bundle.EditTarifaTitle_lastUpdateDate}"  showOn="button"/>

                        <p:outputLabel value="#{bundle.CreateTarifaLabel_lastUpdateBy}" for="lastUpdateBy" />
                        <p:inputText id="lastUpdateBy" value="#{tarifaController.selected.lastUpdateBy}" title="#{bundle.CreateTarifaTitle_lastUpdateBy}" required="true" requiredMessage="#{bundle.CreateTarifaRequiredMessage_lastUpdateBy}"/>

                        <p:outputLabel value="#{bundle.CreateTarifaLabel_idTipoPago}" for="idTipoPago" />
                        <p:selectOneMenu id="idTipoPago" value="#{tarifaController.selected.idTipoPago}" required="true" requiredMessage="#{bundle.EditTarifaRequiredMessage_idTipoPago}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{tipoPagoController.items}"
                                           var="idTipoPagoItem"
                                           itemValue="#{idTipoPagoItem}"
                                           itemLabel="#{idTipoPagoItem.descripcion.toString()}"
                                           />
                            <f:converter binding="#{tipoPagoConverter}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{tarifaController.saveNew}" value="#{bundle.Save}" update="display,:TarifaListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,TarifaCreateDialog);"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="TarifaCreateDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
